<template>
  <div class="mui-numbox" data-numbox-min='1' >
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input id="test" class="mui-input-numbox" type="number" :value='initcount' ref="numval" @change="change"/>
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
 </div>
</template>

<script>
import mui from '@/lib/mui/js/mui.js'
    export default {
       mounted(){  //初始化mui控件
           mui('.mui-numbox').numbox()
       },
       created(){
           
       },
       data(){
           return {
               count: 1
           }
       },
        methods:{
            change(){
                //监听数量的变化
               console.log(this.$refs.numval.value)
               var goods = {id: this.id,count:parseInt(this.$refs.numval.value)}
               this.$store.commit('savecount',goods)
            }
        },
        props: ['initcount','id']
        
    }
</script>

<style scoped>

</style>